//
//  Main_Search_Recommended_TableView_Cell.m
//  Time
//
//  Created by dllo on 16/7/29.
//  Copyright © 2016年 司昌宝. All rights reserved.
//

#import "Main_Search_Recommended_TableView_Cell.h"

@interface Main_Search_Recommended_TableView_Cell ()

@property (nonatomic,retain) UILabel *recommendedTitleLabel;

@end

@implementation Main_Search_Recommended_TableView_Cell

-(void)dealloc {
    [_recommendedTitleLabel release];
    [_title release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.recommendedTitleLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.recommendedTitleLabel];
        [_recommendedTitleLabel release];
    }
    return self;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    
    self.recommendedTitleLabel.textAlignment = NSTextAlignmentCenter;
    self.recommendedTitleLabel.font = [UIFont systemFontOfSize:15.0];
    [self.recommendedTitleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(20);
        make.right.equalTo(self.contentView.mas_right).offset(-20);
        make.top.equalTo(self.contentView.mas_top).offset(10);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-10);
    }];
}

-(void)setTitle:(NSString *)title{
    if (_title != title) {
        [_title release];
        _title = [title retain];
    }
    self.recommendedTitleLabel.text = title;
}


@end
